<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>学生管理信息系统</title>
</head>
<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript">
var flag=0;
function getClick()
{
	var url = 'json/login';
	var params = Form.serialize('form1');
	var myAjax = new Ajax.Request(
	url,
	{
		method:'post',
		parameters:params,
		onComplete: processResponse0,
		asynchronous:true
	});
}
function processResponse0(request)
{
	var res = request.responseText.evalJSON();
	if(res['result']['flag']=="true")
		$("show").innerHTML +=res['result']['userName']+res['result']['userId'];
	else alert(res['result']['flag']);
}
function processResponse1(request)
{
	var res = request.responseText.evalJSON();
	$("show").innerHTML +=res['result']['flag'];
}
function online(){
	{
		var url = 'json/online';
		var myAjax = new Ajax.Request(
		url,
		{
			method:'post',
			parameters:"",
			onComplete: processResponse2,
			asynchronous:true
		});
	}
}
function processResponse2(request){
	var res = request.responseText.evalJSON();
	$("show").innerHTML +=res['result']['online'];
}
</script>
<body onload="online()">
<form action="login" id="userCheck" method="post">
<input type="text" name="id"/>
<input type="password" name="userPwd"/>
<input class="button" type="submit" value="登录" onclick="formActionChange('user_login','userCheck')"/>
<input class="button" type="submit" value="注册" onclick="formActionChange('register.jsp')"/>
</form>
<form id="form1" method="post">
<input type="text" name="id"/>
<input type="password" name="userPwd"/>
<input class="button" type="button" value="登录" onclick="getClick()"/>
<input class="button" type="button" value="注册" onclick="getClick()"/>
</form>
<form id="form2" method="post">
<input type="text" name="id"/>
<input type="password" name="userPwd"/>
<input type="password" name="userPwd"/>
<input type="password" name="userPwd"/>
<input class="button" type="button" value="更改" onclick="getClick2()"/>
</form>
<iframe src="upload/upload.html"></iframe>
<div id='show'></div>
</body>
</html>